Restore specbound keyboard-locals in the correct KBOARD
authorPo Lu <luangruo@yahoo.com>
Thu, 23 May 2024 07:19:46 +0000 (15:19 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 23 May 2024 07:19:46 +0000 (15:19 +0800)
commit64cced2c37a9926fe6ff1c6ad9b9540abd47e21c
tree3cf6244da2ed8116e87b5d70a036667a3a43c506
parentad0b9b9ab5dc58ee4e6277b642b325970c63a4f7
Restore specbound keyboard-locals in the correct KBOARD

* doc/lispref/variables.texi (Intro to Buffer-Local): Fix typo
in documentation.

* src/data.c (KBOARD_OBJFWDP): Move to lisp.h.
(kboard_for_bindings): New variable.
(do_symval_forwarding, store_symval_forwarding): Call
kboard_for_bindings rather than retrieving this value directly.
(set_default_internal): New argument WHERE; if valcontents be a
Lisp_Kboard_Objfwd and WHERE be specified, save the binding
there.  All callers changed.

* src/eval.c (specpdl_where): Adjust for changes in structure
layout.
(specpdl_kboard): New function.
(do_specbind): Clear let->where.kbd in ordinary SPECPDL_LETs,
and set it to the kboard where the binding will be installed if
binding keyboard forwards.
(specbind, do_one_unbind, specpdl_unrewind): Provide
specpdl_kboard in invocation of set_default_internal.

* src/keyboard.c (delete_kboard): Clean thread specpdls of
references to kboards.

* src/keyboard.h (KBOARD_OBJFWDP): Move from data.c.

* src/lisp.h (union specbinding) <let.where>: Convert into
union of KBOARD and Lisp_Object.

* src/thread.c (all_threads): Export.

* src/thread.h: Adjust correspondingly.
doc/lispref/variables.texi
src/data.c
src/eval.c
src/keyboard.c
src/keyboard.h
src/lisp.h
src/thread.c
src/thread.h